<form method="post" class="form-x one-form form-auto" action="{url()}">
    <div class="tab one-tab">
        <div class="panel one-box  active">
            <div class="panel-head">
                <div class="tab-head">
                    <strong>{$name}业绩</strong>
                    <ul class="tab-nav">
                        <li class="active"><a href="#tab-1">基本信息</a>
                        </li>
                    </ul>
                </div>
            </div>
            <div class="tab-body">
                <div class="tab-panel active" id="tab-1">
                    <div class="form-group">
                        <div class="label">
                            <label>付款日期</label>
                        </div>
                        <div class="field">
                            <input type="text" class="input" id="time" name="time" size="60" datatype="*" value="{$info.time}">
                            <div class="input-note">付款日期请不要填写特殊字符，格式：2015-01-01</div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="label">
                            <label>付款方式</label>
                        </div>
                        <div class="field">
                            <input type="text" class="input" id="type" name="type" size="60" datatype="*" value="{$info.type}">
                            
                            <div class="input-note">付款方式请不要填写特殊字符，格式：支付宝、网银、农行</div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="label">
                            <label>付款金额</label>
                        </div>
                        <div class="field">
                            <input type="text" class="input" id="price" name="price" size="60" datatype="*" value="{$info.price}">
                            
                            <div class="input-note">付款金额请不要填写特殊字符，格式：100、200.5</div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="label">
                            <label>付款名称</label>
                        </div>
                        <div class="field">
                            <input type="text" class="input" id="name" name="name" size="60" datatype="*" value="{$info.name}">
                            
                            <div class="input-note">付款名称请填写客户付款时名称，方便查账</div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="label">
                            <label>付款级别</label>
                        </div>
                        <div class="field">
                            <input type="text" class="input" id="level" name="level" size="60" datatype="*" value="{$info.level}">
                            
                            <div class="input-note">付款级别请不要填写特殊字符，格式：1钻、2钻、3钻、皇冠</div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="label">
                            <label>销售客服</label>
                        </div>
                        <div class="field">
                            <input type="text" class="input" id="kf" name="kf" size="60" datatype="*" value="{$info.kf}">
                            
                            <div class="input-note">销售客服请填写员工编号</div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="label">
                            <label>客户Q Q</label>
                        </div>
                        <div class="field">
                            <input type="text" class="input" id="kh" name="kh" size="60" datatype="*" value="{$info.kh}">
                            
                            <div class="input-note">客户Q Q请填写客户实际QQ</div>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="label">
                            <label>备&nbsp;&nbsp;注</label>
                        </div>
                        <div class="field">
                            <textarea class="input" id="content" name="content"  rows="3" cols="62" >{$info.content}</textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="label">
                            <label>付款截图</label>
                        </div>
                        <div class="field">
                            <input type="text" class="input" id="images" name="images" size="38" value="{$info.images}">
                            <a class="button bg-blue button-small  js-img-upload" data="images" id="image_upload" preview="image_preview" href="javascript:;" ><span class="icon-upload"> 上传</span></a>
                            <a class="button bg-blue button-small icon-picture-o" id="image_preview" href="javascript:;" > 预览</a>
                        </div>
                    </div>
                    
                    <div class="form-group">
                        
                    </div>
                    
                    <div id="expand"></div>
                    <div class="form-group">
                        <div class="label">
                            <label>审核状态</label>
                        </div>
                        <div class="field">
                                <div class="button-group radio">
                                    <if condition="$info.status == 1">
                                        <label class="button active"><input name="status" value="1" checked="checked" type="radio">
                                        <span class="icon icon-check"></span> 已审核</label>
                                        <label class="button"><input name="status" value="0" type="radio">
                                        <span class="icon icon-times"></span> 未审核</label>
                                    <else/>
                                        <label class="button"><input name="status" value="1" checked="checked" type="radio">
                                        <span class="icon icon-check"></span> 已审核</label>
                                        <label class="button active"><input name="status" value="0" type="radio">
                                        <span class="icon icon-times"></span> 未审核</label>
                                    </if>
                                </div>
                                <div class="input-note">审核开单信息</div>
                            </div>
                    </div>
                </div>
            </div>
            <div class="panel-foot">
                <div class="form-button">
                    <div id="tips"></div>
                    <input type="hidden" name="id" id="id" type="hidden" value="{$info.id}">
                    <button class="button bg-main" id="ajaxSave" type="button">保存</button>
                    <button class="button bg" type="reset">重置</button>
                </div>
            </div>
        </div>
    </div>
</form>
<script>
    // ajax 提交表单
    $(document).ready(function(){
        $("#ajaxSave").click(function(){    // 提交按钮触发事件
            var url = $("#form").attr("action");    // 获取 表单的 提交地址
            // 序列化 表单数据 后提交
            $.post(url,$("form").serialize(),function(data){
                // data 是 ajaxreturn 返回的 数据
                if(data['status'] == 1){    // 处理成功后
                    layer.alert(data['info'], {icon : 1} , function(index){
                        window.location.reload();   // 刷新当前页面
                        layer.close(index); // 关闭遮罩层
                    });
                } else {
                    // 处理失败后 刷新页面
                    layer.alert(data['info'], {icon : 0} , function(index){
                        layer.close(index); // 关闭遮罩层
                    });
                }

            });
        });
    });
</script>